﻿@using MvcCookieAuthSample.ViewModels;
@model ConsentViewModel

<p>Consent Page</p>
<div class="row page-header">
    <div class="col-sm-10">
        @if(!string.IsNullOrWhiteSpace(Model.ClientLogoUrl))
        {
            <div><img height="150" width="300" src="@Model.ClientLogoUrl" /></div>
        }
        <h1>
            @Model.ClientName
            <small>希望使用你的账户</small>
        </h1>
    </div>
</div>
<div class="row">
    <div class="col-sm-8">
        <form asp-action="Index">
            <input type="hidden" asp-for="ReturnUrl" />
            <div class="alert alert-danger">
                <div asp-validation-summary="All" class="danger"></div>
            </div>
            @if (Model.IdentityScopes.Any())
            {
                <div>
                    <div class="panel-heading">
                        <span class="glyphicon glyphicon-user"></span>
                        用户信息
                    </div>
                    <ul class="list-group">
                        @foreach (var scope in Model.IdentityScopes)
                        {
                            @Html.Partial("ScopeListItem", scope)

                        }
                    </ul>
                </div>
            }
            @if (Model.ResourceScopes.Any())
            {
                <div>
                    <div class="panel-heading">
                        <span class="glyphicon glyphicon-tasks"></span>
                        应用权限
                    </div>
                    <ul class="list-group">
                        @foreach (var scope in Model.ResourceScopes)
                        {
                            @Html.Partial("ScopeListItem", scope)
                        }
                    </ul>
                </div>

            }

            <div>
            <label>
                <input type="checkbox" asp-for="RememberConsent" />
                <strong>记住我的选择</strong>
            </label>
        </div>
        <div>
        <button name="button" value="yes" class="btn btn-primary"  autofocus>同意</button>
        <button name="button" value="no" >取消</button>
        @if (!string.IsNullOrEmpty(Model.ReturnUrl))
        {
            <a href="@Model.ClientUrl" class="pull-right btn btn-default">
                <span class="glyphicon glyphicon-info-sign"></span>
                <strong>@Model.ClientUrl</strong>
            </a>
        }
</div>
        </form>
    </div>    
</div>